
import { createRouter, createWebHashHistory} from 'vue-router'


const vuerouter=  createRouter ({
  history: createWebHashHistory(),
  routes:[
    // {
    //   path: '/',/**模块1 */
    //   name: 'index',
    //   component: () => import('../src/views/1/index.vue')
    // },
    // {
    //   path: '/index2',/**模块2 */
    //   name: 'index2',
    //   component: () => import('../src/views/2/index.vue')
    // },
    {
      path: '/',/**模块3 */
      name: 'index3',
      component: () => import('../index.vue')
    },
    // {
    //   path: '/index4',/**模块4 */
    //   name: 'index4',
    //   component: () => import('../src/views/4/index.vue')
    // },
   
  ]
})
// 设置title的方法
vuerouter.beforeEach((to,from,next)=>{
 // 根据路由元信息设置文档标题
  window.document.title = to.meta.title || 'test'
  next()
})

export default vuerouter
